local m = require('utils.vim')
local e = require('utils.editor')

-- 在每一行开头或未尾自动加上指定字符
-- 部分行操作用`<leader>0`先放到单独浮窗中
-- %s/^/<char>/
m.map("n", "zb", function()
    local left_keypresses = "\\<Left>" --往左移动一个字符位置
    local k = ':%s/^//' .. left_keypresses
    e.send_key(k)
end,{desc="Add char at the beginning of each line"})

-- %s/$/<char>/
m.map("n", "ze", function()
    local left_keypresses = "\\<Left>"
    local k = ':%s/$//' .. left_keypresses
    e.send_key(k)
end,{desc="Add char at the end of each line"})

-- EOP
